import torch.nn as nn
class IMUDNNModel(nn.Module):
    def __init__(self, input_size, hidden_sizes, output_size):
        super(IMUDNNModel, self).__init__()
        # 构建全连接层，使用 ModuleList 以便定义多层网络
        layers = []
        in_features = input_size
        for hidden_size in hidden_sizes:
            layers.append(nn.Linear(in_features, hidden_size))
            layers.append(nn.ReLU())
            in_features = hidden_size
        layers.append(nn.Linear(in_features, output_size))

        # 将所有层打包
        self.fc = nn.Sequential(*layers)

    def forward(self, x):

        #x = x.view(x.size(0), -1)
        return self.fc(x)